﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MockDataTransferObject;
using MockCommon;
using System.Data;
using System.Data.SqlClient;
using System.Collections.ObjectModel;
namespace MockDataAccess
{
    public class ReasonDataAccess : BaseDataAccess<Reason>
    {
        private Collection<SqlParameter> _parameters;

        /// <summary>
        /// Initializes a new instance of the <see cref="ReasonDataAccess"/> class.
        /// </summary>
        public ReasonDataAccess()
            : base()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="ReasonDataAccess"/> class.
        /// </summary>
        /// <param name="isFake">if set to <c>true</c> [is fake].</param>
        public ReasonDataAccess(bool isFake)
            : base(isFake)
        {
        }

        #region Is
        #endregion

        #region Get
        /// <summary>
        /// Gets the name of the reason text by status.
        /// </summary>
        /// <param name="timesheetId">The timesheet id.</param>
        /// <param name="statusName">Name of the status.</param>
        /// <returns></returns>
        public object GetReasonTextByStatusName(Guid timesheetId, string statusName)
        {
            _parameters = new Collection<SqlParameter>();
            _parameters.Add(new SqlParameter { ParameterName = Constant.ParameterStatusName, Value = statusName });
            _parameters.Add(new SqlParameter { ParameterName = Constant.ParameterTimesheetId, Value = timesheetId });
            object result = ExecuteQueryAsScalar(Constant.ReasonGetReasonTextByStatusName, _parameters);
            return result;
        }
        #endregion

    }
}
